package com.travelsky.airchina.boarding.dao.impl.hibernate;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.travelsky.airchina.boarding.dao.ProductAttributeDAO;
import com.travelsky.airchina.boarding.domain.ProductAttribute;


@Repository("productAttributeDAO")
public class ProductAttributeDAOImpl extends GenericDAOHibernate<ProductAttribute, Long,ProductAttributeDAO> implements ProductAttributeDAO{
	@Autowired
	public ProductAttributeDAOImpl(SessionFactory sessionFactory){
		this.setSessionFactory(sessionFactory);
	}
	public void deleteProductAttributeByProductId(Long id) {
		String hql = "delete from ProductAttribute prd_attr_ where prd_attr_.product.id = ? ";
		this.getHibernateTemplate().bulkUpdate(hql, id);
	}

}
